/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 jfinal app. jfapp Group.
 */

define(['adminapp'], function ($app) {
    $app.navactive('game_sign');

    var source = $("#message-template").html();
    var template = Handlebars.compile(source);

    var callback = function(msg) {
        var e = $("#tip").find("#alert");
        if (e) {
            $(e).remove();
        }
        if (msg.status == "OK") {
            var context = {class : "alert-success", message : msg.message};
            $("#tip").prepend(template(context))
        } else {
            var context = {class : "alert-success", message : msg.message};
            $("#tip").prepend(template(context))
        }
    }

    $("#save").click(function() {
        $("#ajaxForm").ajaxSubmit({
            success : callback
        });
    });
});

